package es.ibm.santillana.mdm.xml;

import javax.xml.parsers.ParserConfigurationException;

import com.ibm.pim.context.Context;

import es.ibm.santillana.mdm.common.util.ConstSantillana;

/**
 * This class consists exclusively of one method to get the needed state
 * implementing the Factory pattern.
 * @author dmanso
 *
 */
public class XMLIntegrationFactory {

	/**
	 * Returns the  s
	 * @param estados Movement that we will instantiate.
	 * @param ctxPIM - MDM Application Context.
	 * @return
	 * @throws ParserConfigurationException
	 */
	public static XMLIntegration getStateXML(
			ConstSantillana.exportStates estados, Context ctxPIM, String catalogName, String sPk)
			throws ParserConfigurationException {
		switch (estados) {
			case insert:
				return new InsertXML(ctxPIM,catalogName,sPk);
			case update:
				return new UpdateXML(ctxPIM,catalogName,sPk);
			case delete:
				return new DeleteXML(ctxPIM,catalogName,sPk);
			default:
				return null;
		}
	}
}
